﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

using System.Data.SQLite;

namespace PowerWaveAddin
{
    class DataHelper
    {
        /// <summary>
        /// Location of the wave notes appdir
        /// </summary>
        private static readonly string appDir = Environment.GetFolderPath( Environment.SpecialFolder.ApplicationData) + "Wave Notes";

        /// <summary>
        /// Name of the datafile in the appdir
        /// </summary>
        private static readonly string dbFileName = "Wave Notes DB.db3";

        /// <summary>
        /// Checks that the ap dir exists and creates it if it doesn't
        /// </summary>
        public static void EnsureAppDirExists()
        {
            if (!Directory.Exists(appDir))
            {
                Directory.CreateDirectory(appDir);
            }
        }

        /// <summary>
        /// Saves presentation info to the DB in the appdir
        /// </summary>
        /// <param name="presentation"></param>
        public static void SavePresentationInfo(PresentationInfo presentation)
        {
        }

        /// <summary>
        /// Add a user emai and id to the DB
        /// </summary>
        /// <param name="user"></param>
        public static void AddUser(userInfo user)
        {
        }

        /// <summary>
        /// Gets info on a presentation if it has previously been exported
        /// </summary>
        /// <param name="fileName"></param>
        /// <returns></returns>
        public static PresentationInfo GetPresentationByFileName(string fileName)
        {
            return null;
        }

        /// <summary>
        /// Gets all presentations associated with a given user ID.
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public static IList<PresentationInfo> GetPresentationsForUser(int userId)
        {
            return null;
        }
    }

    /// <summary>
    /// Represents a presentation record
    /// </summary>
    class PresentationInfo
    {
        public string Name { get; set; }
        public string Key { get; set; }
    }

    /// <summary>
    /// Represents a user record
    /// </summary>
    class userInfo
    {
        public int id { get; set; }
        public string address { get; set; }
    }
}
